package com.mineoj.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mineoj.model.dto.file.FileMessageQueryRequest;
import com.mineoj.model.entity.FileMessage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mineoj.model.entity.FileMessage;
import com.mineoj.model.entity.FileMessage;
import com.mineoj.model.entity.User;
import com.mineoj.model.enums.FileUploadBizEnum;
import com.mineoj.model.vo.FileMessageVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
* @author 明月
* @description 针对表【file_message】的数据库操作Service
* @createDate 2025-04-11 10:13:48
*/
public interface FileMessageService extends IService<FileMessage> {

    /**
     *
     * 文件校验
     * @param multipartFile 文件
     * @param fileUploadBizEnum
     */
    void validFile(MultipartFile multipartFile, FileUploadBizEnum fileUploadBizEnum);

    /**
     *
     * 保存文件
     * @param file 文件
     * @param loginUser 用户
     * @param fileUploadBizEnum 业务类型
     */
    void saveFile(FileMessage file, User loginUser, FileUploadBizEnum fileUploadBizEnum);

    /**
     *
     * 获取查询条件
     * @param fileMessageQueryRequest
     * @return
     */
    QueryWrapper<FileMessage> getQueryWrapper(FileMessageQueryRequest fileMessageQueryRequest);

    /**
     *
     * 获取题目封装
     * @param fileMessage
     * @param request
     * @return
     */
    FileMessageVO getFileMessageVO(FileMessage fileMessage, HttpServletRequest request);

    /**
     * 分页获取题目封装
     *
     * @param fileMessagePage
     * @param request
     * @return
     */
    Page<FileMessageVO> getFileMessageVOPage(Page<FileMessage> fileMessagePage, HttpServletRequest request);

}
